<template>
  <h2>todolist</h2>
  <TForm @getValue="getValue" />
  <TList :arr="arr" />
</template>

<script>
import Form from "./components/Form.vue";
import List from "./components/List.vue";

export default {
  components: {
    TForm: Form,
    TList: List,
  },
  data() {
    return {
      arr: [
        {
          id: 1,
          name: "张三",
          status: true,
        },
        {
          id: 2,
          name: "里斯",
          status: false,
        },
        {
          id: 3,
          name: "王武",
          status: false,
        },
      ],
    };
  },
  methods: {
    getValue(v) {
      this.arr.push({
        id: new Date().getTime(),
        name: v,
        status: false,
      });
    },
  },
};
</script>

<style></style>
